<template>
  <div style="display: flex;align-items: center;justifyContent:flex-end;">
    <RejectList :nextTicketType="nextTicketType" v-if="$route.path!=='/nextTicket'&&$hasPermission('sys:nextticket:dashboardvieworlistview')"></RejectList>
    <span class="spiltchar" v-if="$route.path!=='/nextTicket'&&$hasPermission('sys:nextticket:dashboardvieworlistview')">|</span>
    <span class="swichbuttton" v-if="$route.path!=='/nextTicket'&&$hasPermission('sys:nextticket:dashboardvieworlistview')"
          @click="changeLayout">
                    <el-tooltip :open-delay="1000"
                                v-if="showGrid"
                                class="item"
                                effect="dark"
                                :content="$t('custom.component.gadget.dashboardView')"
                                placement="top">
                      <span class="swichbuttton1"
                            v-if="showGrid"><img src="@/assets/ticket/grid.png"></span>
                    </el-tooltip>
                    <el-tooltip :open-delay="1000"
                                v-if="showGrid"
                                class="item"
                                effect="dark"
                                :content="$t('custom.component.gadget.listView')"
                                placement="top">
                      <span class="swichbuttton2"
                            v-if="showGrid"><img src="@/assets/ticket/card.png"></span>
                    </el-tooltip>
                    <el-tooltip :open-delay="1000"
                                v-if="!showGrid"
                                class="item"
                                effect="dark"
                                :content="$t('custom.component.gadget.dashboardView')"
                                placement="top">
                      <span class="swichbuttton3"
                            v-if="!showGrid"><img src="@/assets/ticket/grid1.png"></span>
                    </el-tooltip>
                    <el-tooltip :open-delay="1000"
                                v-if="!showGrid"
                                class="item"
                                effect="dark"
                                :content="$t('custom.component.gadget.listView')"
                                placement="top">
                      <span class="swichbuttton4"
                            v-if="!showGrid"><img src="@/assets/ticket/card1.png"></span>
                    </el-tooltip>

                  </span>
  </div>
</template>

<script>
import RejectList from './reject-list.vue'
export default {
  name: 'next-ticket-layout',
  components:{
    RejectList
  },
  props: ['showGrid','nextTicketType'],
  data () {
    return {}
  },
  methods: {
    changeLayout () {
      this.$emit('changeLayout')
    }
  }
}
</script>

<style scoped>
.spiltchar {
  display: flex;
  line-height: 24px;
  height: 24px;
  color: #f0f0f0;
  border-radius: 1px;
  margin: 0 20px;
  font-size: 24px;
}
.swichbuttton {
  width: 64px;
  height: 24px;
  background: #eeeeee;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  /* margin-left: auto; */
}
.swichbuttton > span {
  width: 30px;
  height: 20px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.swichbuttton1 {
  background: #eeeeee;
  text-align: center;
}
.swichbuttton2 {
  background: #138dc7;
}
.swichbuttton3 {
  background: #138dc7;
}
.swichbuttton4 {
  background: #eeeeee;
  text-align: center;
}
.swichbuttton1 > img {
  width: 14px;
  height: 14px;
}
.swichbuttton2 > img {
  width: 14px;
  height: 14px;
}
</style>
